#import <UIKit/UIKit.h>

typedef enum {
    SMOOTH_LINER        = 0,
    SMOOTH_QUADRATIC    ,
} SMOOTHMODE;

extern NSString *const kfKalmanQ;
extern NSString *const kfKalmanR;

/*===================================================================
 说明：
    数据滤波
 ==================================================================*/
@interface MRFilter : NSObject
{
    BOOL        k_first;
    double      k_q, k_r, k_last_data, k_last_gain;
}

+ (id)kalmanWithQ:(double)q R:(double)r;

- (void)reset;

- (double)kalmanData:(double)data;
- (void)kalman:(double *)data length:(NSInteger)N;

+ (void)kalman:(double *)data length:(NSInteger)N;

+ (void)smooth:(double *)data length:(NSInteger)N;

+ (void)linear:(double *)data length:(NSInteger)N;
+ (void)linear:(double *)data length:(NSInteger)N threshold:(CGFloat)threshold;

+ (void)quickSort:(double *)data length:(NSInteger)N;
+ (void)bubbleSort:(double *)data length:(NSInteger)N;

@end
